(function(window) {
    var User_get_study_cardsCtrl = {
        data: {},
        init: function(data) {
            //alert(1);
            //$(".toolbar").hide();	
            this.bindEven();
           // this.timepp();
            //data['timepp']=setInterval(User_get_study_cardsCtrl.timepp(),1000);
        },
        bindEven: function() {
            var bindings = [{
                // element:document,
                element: '#signBtn',
                event: hiApp.device.click,
                handler: this.sign
            }];
            bindEvents(bindings);
        },

        
        sign: function() {
            $(this).unbind(hiApp.device.click);
            $.post(base_url + "/User/get_study_cards", {
                code: $("#KnowledgeVaule").val(),
            }, function(data) {
                data=JSON.parse(data);
                if (data.error > 0) {
                    User_get_study_cardsCtrl.bindEven();
                    hiApp.alert(data.msg);
                } else {
                    hiApp.alert("领取成功");
                    $("#signBtn").text("已领取");
                }
            })

        },


    };

    window.BoxEdu_User_get_study_cardsCtrl = User_get_study_cardsCtrl;

})(window);
